<script setup lang="ts">
import { useMenuStore } from '@/stores/menu'
import { useRouter } from 'vue-router'
const menuStore = useMenuStore()
const router = useRouter()
const roleId = localStorage.getItem('ROLE_ID')

if (roleId) {
    const currentPath = location.pathname
    menuStore.saveMenuList(Number(roleId)).then(() => {
        // 登录成功进入主界面
        router.replace(currentPath)
    })
}
</script>

<template>
    <RouterView />
</template>

<style scoped></style>
